package com.minimalist.common.entity.lindi.vo.purchaseapplicationprojectitem;

import cn.hutool.core.date.DatePattern;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.minimalist.common.utils.Add;
import com.minimalist.common.utils.Update;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;

/**
 * 林地指标交易平台_购买申请项目指标 VO类。
 *
 * @author 11987
 * @since 2025-07-01
 */
@Schema(description = "林地指标交易平台_购买申请项目指标")
public class LindiPurchaseApplicationProjectItemVO implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    // ========== 基本信息 ==========

    @NotNull(message = "购买申请ID不能为空", groups = {Add.class, Update.class})
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(description = "购买申请ID")
    private Long purchaseApplicationId;

    @NotNull(message = "项目编号不能为空", groups = {Add.class, Update.class})
    @Schema(description = "项目编号")
    private String projectCode;

    @Schema(description = "项目名称")
    private String projectName;

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(description = "项目ID")
    private Long projectId;

    @Schema(description = "项目指标")
    private String projectIndex;

    // ========== 审计字段 ==========

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(description = "创建人ID")
    private Long createId;

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(description = "更新人ID")
    private Long updateId;

    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    // Getter和Setter方法
    public Long getPurchaseApplicationId() {
        return purchaseApplicationId;
    }

    public void setPurchaseApplicationId(Long purchaseApplicationId) {
        this.purchaseApplicationId = purchaseApplicationId;
    }

    public String getProjectCode() {
        return projectCode;
    }

    public void setProjectCode(String projectCode) {
        this.projectCode = projectCode;
    }

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public Long getProjectId() {
        return projectId;
    }

    public void setProjectId(Long projectId) {
        this.projectId = projectId;
    }

    public String getProjectIndex() {
        return projectIndex;
    }

    public void setProjectIndex(String projectIndex) {
        this.projectIndex = projectIndex;
    }

    public Long getCreateId() {
        return createId;
    }

    public void setCreateId(Long createId) {
        this.createId = createId;
    }

    public Long getUpdateId() {
        return updateId;
    }

    public void setUpdateId(Long updateId) {
        this.updateId = updateId;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        LindiPurchaseApplicationProjectItemVO that = (LindiPurchaseApplicationProjectItemVO) o;
        return Objects.equals(purchaseApplicationId, that.purchaseApplicationId)
                && Objects.equals(projectCode, that.projectCode)
                && Objects.equals(projectName, that.projectName)
                && Objects.equals(projectId, that.projectId)
                && Objects.equals(projectIndex, that.projectIndex)
                && Objects.equals(createId, that.createId)
                && Objects.equals(updateId, that.updateId)
                && Objects.equals(createTime, that.createTime)
                && Objects.equals(updateTime, that.updateTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(purchaseApplicationId, projectCode, projectName, projectId, projectIndex, createId, updateId, createTime, updateTime);
    }
}